<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>云漫酒店-登陆</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="/layui/css/index.css" media="all">
    <style>
        #container{height:100%;width:100%;}
        input:-webkit-autofill {-webkit-box-shadow:inset 0 0 0 1000px #fff;background-color:transparent;}
        .admin-login-background {width:300px;height:300px;position:absolute;left:50%;top:40%;margin-left:-150px;margin-top:-100px;}
        .admin-header {text-align:center;margin-bottom:20px;color:#ffffff;font-weight:bold;font-size:40px}
        .admin-input {border-top-style:none;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;height:50px;width:300px;padding-bottom:0px;}
        .admin-input::-webkit-input-placeholder {color:#a78369}
        .layui-icon-username {color:#a78369 !important;}
        .layui-icon-username:hover {color:#9dadce !important;}
        .layui-icon-password {color:#a78369 !important;}
        .layui-icon-password:hover {color:#9dadce !important;}
        .admin-input-username {border-top-style:solid;border-radius:10px 10px 0 0;}
        .admin-input-verify {border-radius:0 0 10px 10px;}
        .admin-button {margin-top:20px;font-weight:bold;font-size:18px;width:300px;height:50px;border-radius:5px;background-color:#a78369;border:1px solid #d8b29f}
        .admin-icon {margin-left:260px;margin-top:10px;font-size:30px;}
        i {position:absolute;}
        .admin-captcha {position:absolute;margin-left:205px;margin-top:-40px;}
    </style>
</head>
<body>
<div id="container">
    <div></div>
    <div class="admin-login-background">
        <div class="admin-header">
            <span>云漫酒店系统</span>
        </div>
        <form class="layui-form" action="/tologin.do" method="post">
            <div>
                <i class="layui-icon layui-icon-username admin-icon"></i>
                <input type="text" name="loginname" placeholder="请输入用户名" autocomplete="off" class="layui-input admin-input admin-input-username">
            </div>
            <div>
                <i class="layui-icon layui-icon-password admin-icon"></i>
                <input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input admin-input">
            </div>
            <div>
                <input type="text" id="checks" name="inputStr" placeholder="请输入验证码" autocomplete="off" class="layui-input admin-input admin-input-verify">
                <img class="admin-captcha"  id="imgVerify" src="/login.do" onclick="getVerify()" width="90" height="30">
            </div>
            <button class="layui-btn admin-button">登 陆</button>
			<div>
			<button class="layui-btn admin-button"><a href="/layui/newuser.jsp">注 册</a></button>
			</div>
        </form>
    </div>
</div>
<script src="/layui/js/layui.js" charset="utf-8">

    // $(document.body).ready(function () {
    //     //首次获取验证码
    //     $("#imgVerify").attr("src","layui/login.do?random"+Math.random());
    // });
    //更换验证码
    function getVerify(){
        var src1=document.getElementById('imgVerify')
        src1.src = "/login.do?random="+Math.random();
    }

    //校验验证码
    // function checkSum(){
    //     var html1=document.getElementById('loginingForm');
    //     var inputStr = $("#checks").val();
    //     if(inputStr!=null && inputStr!=" "){
    //         inputStr = inputStr.toUpperCase();//将输入的字母全部转换成大写
    //         html1.action="/login.do?inputStr="+inputStr;//提交表单
    //     }else{
    //         alert("验证码不能为空!")
    //     }
    // }

    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer;

        // 登录过期的时候，跳出ifram框架
        if (top.location != self.location) top.location = self.location;

        // 进行登录操作
        form.on('submit(login)', function (data) {
            data = data.field;
            if (data.username == '') {
                layer.msg('用户名不能为空');
                return false;
            }
            if (data.password == '') {
                layer.msg('密码不能为空');
                return false;
            }

        });
    });
</script>

</body>
</html>